<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>管理员注册</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/vendor/simple-line-icons/css/simple-line-icons.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/vendor/font-awesome/css/fontawesome-all.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/css/styles.css">
</head>
<body>
<div class="page-wrapper flex-row align-items-center">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-5">
                <div class="card p-4">
                    <div class="card-header text-center text-uppercase h4 font-weight-light">
                        注册
                    </div>
<form action="<c:url value='/ManagementServlet'/>" method="POST">
<input type="hidden" name="method" value="doRegistAdmin"/>
                    <div class="card-body py-5">
                        <div class="form-group">
                            <label class="form-control-label">用户名</label>
                            <input type="name" class="form-control" name="username" value="${request.username}"/>
                        </div>

                        <div class="form-group">
                            <label class="form-control-label">密码</label>
                            <input type="password" class="form-control" name="password" value="${requset.password}"/>
                        </div>
						<div class="form-group">
                            <label class="form-control-label">姓名</label>
                            <input type="name" class="form-control" name="name" value="${request.name}"/>
                        </div>
						<div class="form-group">
                            <label class="form-control-label">民族</label>
                            <input type="name" class="form-control" name="nation" value="${requset.nation}";>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">身份证号码</label>
                            <input type="text" class="form-control" id="idcard" name="idcard" value="${request.idcard}" onblur="getBirthday()"/>
                        </div>
						<div class="form-group">
                            <label class="form-control-label">生日</label>
                            <input type="text" class="form-control" id="birthday" name="birthday" value="${request.birthday}"/>
                        </div>

						<div class="form-group">
                            <label class="form-control-label">手机号</label>
                            <input type="text" class="form-control" name="phone" value="${request.phone}"/>
                        </div>
						<div class="form-group">
                            <label class="form-control-label">管理宿舍楼栋</label>
                            <input type="phone" class="form-control" name="dormitory_number" value="${request.dormitory_number}"/>
                        </div>
                    </div>

                    <div class="card-footer">
                        <button type="submit" class="btn btn-success btn-block">注册</button>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
function getBirthday(){
	var idcard = document.getElementById("idcard").value;
	var arr = new Array();
	arr.push(idcard.substring(6,10));
	arr.push(idcard.substring(10,12));
	arr.push(idcard.substring(12,14));
	document.getElementById("birthday").value = arr.join("-");
}
</script>
<script src="${pageContext.request.contextPath}/pages/vendor/jquery/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/vendor/popper.js/popper.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/vendor/chart.js/chart.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/js/carbon.js"></script>
<script src="${pageContext.request.contextPath}/pages/js/demo.js"></script>
</body>
</html>
